package com.quectel.leshan.quecleshan;

import org.eclipse.californium.core.CoapResource;
import org.eclipse.californium.core.network.Exchange;
import org.eclipse.californium.core.server.resources.CoapExchange;

public class HelloCoapResource extends CoapResource {


    public HelloCoapResource(String name) {
        super(name);
    }

    @Override
    public void handlePOST(CoapExchange exchange) {
        System.out.println(">>>>>>>>> get post request");
        System.out.println(exchange.getRequestText());
        System.out.println("<<<<<<<<<");
        exchange.respond("hi ,this is quec leshan server");
    }

    @Override
    public void handleGET(CoapExchange exchange) {
        super.handleGET(exchange);
    }

    @Override
    public void handleRequest(Exchange exchange) {
        super.handleRequest(exchange);
    }

    @Override
    public void handlePUT(CoapExchange exchange) {
        super.handlePUT(exchange);
    }

    @Override
    public void handleDELETE(CoapExchange exchange) {
        super.handleDELETE(exchange);
    }
}
